Method and system for enhancing portrait images that are processed in a batch mode

ABSTRACT

A batch processing method for enhancing an appearance of a face located in a digital image, where the image is one of a large number of images that are being processed through a batch process, comprises the steps of: (a) providing a script file that identifies one or more original digital images that have been selected for enhancement, wherein the script file includes an instruction for the location of each original digital image; (b) using the instructions in the script file, acquiring an original digital image containing one or more faces; (c) detecting a location of facial feature points in the one or more faces, said facial feature points including points identifying salient features including one or more of skin, eyes, eyebrows, nose, mouth, and hair; (d) using the location of the facial feature points to segment the face into different regions, said different regions including one or more of skin, eyes, eyebrows, nose, mouth, neck and hair regions; (e) determining one or more facially relevant characteristics of the different regions; (f) based on the facially relevant characteristics of the different regions, selecting one or more enhancement filters each customized especially for a particular region and selecting the default parameters for the enhancement filters; (g) executing the enhancement filters on the particular regions, thereby producing an enhanced digital image from the original digital image; (h) storing the enhanced digital image; and (i) generating an output script file having instructions that indicate one or more operations in one or more of the steps (c)-(f) that have been performed on the enhanced digital image.

CROSS-REFERENCE TO RELATED APPLICATION

Reference is made to commonly assigned copending application Ser. No.10/160,421, entitled “Method and System for Enhancing Portrait Images”and filed 31 May 2002 in the names of R. A. Simon, T. Matraszek, M. R.Bolin, and H. Nicponski, which is assigned to the assignee of thisapplication.

FIELD OF THE INVENTION

The present invention relates generally to the field of digital imageprocessing, and in particular to the creation of improved imagingproducts derived from portrait-type images of human subjects.

BACKGROUND OF THE INVENTION

For centuries, only the wealthy or privileged classes of society couldafford to employ the skilled artisans who labored to produce a finelikeness in painting, sculpture, and drawing. In many cases, portraitureserved a purpose greater than the simple creation of an acceptablelikeness of reality. In subtle or overt ways, the artist's work wouldinteract with the desires and intentions of the subjects. A secondcategory of artistic license involved improvement on reality. Thus,subjects were rendered in such a way as to minimize their physicalimperfections and to present the most attractive possible appearance.

In modern society, portraiture is no longer the exclusive domain of thewealthy and powerful. The advent of photography into all levels ofsociety has rendered creation of portrait images to be an ubiquitouspart of many of life's major events. Weddings, graduations, birthdays,arrival of a baby—all of these events, and more—are commonly capturedwith relatively standardized portrait images in western cultures. Whilethe state of technology enables individual amateurs to capture and evenenhance images such as these, there still exists a class of professionalphotographers that provide creation of higher-quality portrait images.Not surprisingly, the goals of the portraitist remain the same as inbygone centuries—to present the subject in the most pleasing possibleway. In essence, the subject wants to be seen as they wish they were,not as they really are.

In response to the desire for people to be seen as they wish they are,and not the way they really are, professional photographers resort toretouching the portrait image to give people their preferred appearance.Retouching involves changing a photo image in some way that was notcaptured or depicted in the original photographic image. One of thegoals of retouching a portrait image is to make a person look better byremoving temporary imperfections such as blemishes or dark circles underthe eyes or permanent imperfections such as moles or wrinkles, whilestill maintaining the personality of the individual. Removing facialblemishes, moles and scars, softening lines and wrinkles, decreasingbags under the eyes, whitening teeth and the whites of the eyes areexamples of retouching performed to improve or enhance the appearance ofan individual in a portrait image.

Before the advent of the digital age, retouching of images wereperformed on either the negative or printed image by modifying the imageusing dyes to mask or change imperfections in the portrait image. Nowthat digital image capture devices are routinely available, thepreferred method of retouching is done via digital imaging techniquesperformed on the captured digital images. Digital methods allowenhancements to be performed that were either extremely hard to do orpreviously impossible to perform on the analogue image. Image editingsoftware such as Adobe Photoshop® can be used to refine portraits byremoving blemishes, straightening noses, balancing eyes and applyingdigital make-up.

Improvements in computer technology and image processing algorithms areenabling new classes of automated and semi-automated image enhancements.Relating to the subject of portrait images, relevant technologicaldevelopments include face detection and recognition, facial featuredetection and masking, face re-posing, and red-eye detection andcorrection.

In published PCT Patent Application WO 00/76398 A1, “Skin ImagingAnalysis Systems and Methods”, Hillebrand et al. disclose a system thatcan detect skin defects and calculate a skin severity index. This systemis aimed towards the cosmetic and skin care market. The system can alsosimulate improvements to the defected skin areas that would be realizedupon the use of a recommended treatment or product that eliminates orhides the skin defect. The skin defects are detected using colorinformation and standard morphing techniques are used to simulateimprovements in the defected skin areas.

In published European Patent Application EP 1 030 276 A1, “Method ofCorrecting Face Image, Makeup Simulation Method, Makeup Method, MakeupSupporting Device and Foundation Transfer Film”, Utsugi describes amethod for preparing an ideal post-makeup face through image processingbased on a desirable face or a model face. The technique involves makinghighlighted areas, and the shapes of the eyebrows, the eyelines, and thelip line closer to that of a desirable face or a model face within arange where modification by makeup is possible.

The drawback of such systems, especially for batch portraiture systemsas used, e.g., for weddings, graduations, school and sports pictures,birthdays, arrival of a baby, etc., is the intense interaction requiredwith the customer to input preferences and evaluate results. Forexample, in Utsugi the makeup customer's presence is required to settleon the model face, e.g., selected from the faces of popular talents,actresses or actors, and on the various adjustments made to reach themodel face. Moreover, a skilled operator is required to work with thecustomer to produce an acceptable result.

Even with the advent of digital imaging, therefore, retouching portraitsis a craft unto itself and to this day remains more of an art form thana science. In addition, the process of retouching portrait images is ahighly manual and time consuming process performed by skilled operators.It therefore would be advantageous to develop a system that usesautomated and semi-automated portrait image enhancement methods toenable the facile retouching of portraits. The present invention solvesthe above mentioned shortcomings of the current art by providing methodsand system for automated enhancement of the appearance of the humansubjects in images.

SUMMARY OF THE INVENTION

The present invention is directed to overcoming one or more of theproblems set forth above. Briefly summarized, according to one aspect ofthe present invention, a batch processing method for enhancing anappearance of a face located in a digital image, where the image is oneof a large number of images that are being processed through a batchprocess, comprises the steps of: (a) providing a script file thatidentifies one or more original digital images that have been selectedfor enhancement, wherein the script file includes an instruction for thelocation of each original digital image; (b) using the instructions inthe script file, acquiring an original digital image containing one ormore faces; (c) detecting a location of facial feature points in the oneor more faces, said facial feature points including points identifyingsalient features including one or more of skin, eyes, eyebrows, nose,mouth, and hair; (d) using the location of the facial feature points tosegment the face into different regions, said different regionsincluding one or more of skin, eyes, eyebrows, nose, mouth, neck andhair regions; (e) determining one or more facially relevantcharacteristics of the different regions; (f) based on the faciallyrelevant characteristics of the different regions, selecting one or moreenhancement filters each customized especially for a particular regionand selecting the default parameters for the enhancement filters; (g)executing the enhancement filters on the particular regions, therebyproducing an enhanced digital image from the original digital image; (h)storing the enhanced digital image; and (i) generating an output scriptfile having instructions that indicate one or more operations in one ormore of the steps (c)-(f) that have been performed on the enhanceddigital image.

The advantage of the invention is that it efficiently uses automated andsemi-automated portrait image enhancement methods in a batch process toenable the retouching of portraits without requiring skilled operatorintervention to make and supervise the retouching corrections. Thus, thehighly manual and time consuming processes performed by skilledoperators is avoided and the retouching method may be implemented on abatch process.

These and other aspects, objects, features and advantages of the presentinvention will be more clearly understood and appreciated from a reviewof the following detailed description of the preferred embodiments andappended claims, and by reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are diagrams of a system for practicing the inventionand a graphical user interface for use with the system, respectively.

FIG. 2A is a flowchart of an embodiment for implementing the inventionwith an optional degree of user intervention.

FIG. 2B is a flowchart of an automatic embodiment for implementing theinvention in a batch mode without user intervention.

FIG. 2C is an illustration of a script file having instructions for thelocation and processing of the original digital images in a batch mode.

FIG. 2D is a flowchart of an interactive embodiment for implementing aretouching mode in a batch mode.

FIG. 2E is a flowchart of an interactive embodiment for implementing aretouching mode in a consumer-operated kiosk setting.

FIG. 3 is a flowchart of the facial detection and facial point locationsteps shown in FIGS. 2A and 2B.

FIG. 4 is a pictorial example showing the location of salient featurepoints on a detected face.

FIG. 5A is a flowchart of a method for determining a neck region.

FIGS. 5B-5D are pictorial examples that visually illustrate the processof creating the final neck probability map.

FIG. 6A is a diagram of the ensemble of enhancement filters used in thesystem illustrated in the flowcharts of FIGS. 2A and 2B.

FIG. 6B is a flowchart of a method for creating a hair mask for aforehead area.

FIG. 7A is a flowchart for a skin texture enhancing filter shown in FIG.6.

FIG. 7B is a diagram of a pixel neighborhood comprising the valley edgefilter kernal used by the skin texture enhancing filter.

FIG. 8 is a flow chart showing a preferred embodiment of selecting andmodifying skin features according to the invention.

FIG. 9 is a pictorial example of a pinwheel filter illustrating linesegments defined around a defect pixel.

FIGS. 10A and 10B together represent a flow chart illustrating a processutilizing the pinwheel filter of FIG. 9 for estimating corrected valuesfor a defect pixel.

FIG. 11 is a flow chart illustrating a preferred embodiment forcalculating new pixel values in the process illustrated in FIG. 10.

FIG. 12 is a flow chart illustrating a process for creating linesegments through a feature pixel in the pinwheel filter shown in FIG. 9.

FIG. 13 is a flow chart of a presently preferred embodiment of the skintone enhancing filter as shown in FIG. 6.

FIG. 14 is a flow chart of a presently preferred embodiment of thecalculation of shadow/highlight strength for use in the skin toneenhancing filter shown in FIG. 13.

FIGS. 15A, 15B and 15C are illustrations of several functions showingthe effect of different blending coefficients used in the skin enhancingfilter shown in FIG. 13.

FIG. 16 is a flow chart of a presently preferred embodiment of the teethand eye enhancing filters shown in FIG. 6.

FIG. 17 is an illustration of a blending function used in the skintexture enhancing filter.

FIGS. 18A and 18B are pictorial examples of the control points used inmaking a shape adjustment of an eye.

FIG. 19 is a flowchart for a presently preferred embodiment of a shapeenhancing filter as shown in FIG. 6.

FIGS. 20A and 20B show retexturing curves where (FIG. 21A) theretexturing is a function of the level of enhancement and where (FIG.21B) the retexturing is a function of the local smoothness of skin.

DETAILED DESCRIPTION OF THE INVENTION

Because image processing systems employing facial feature detection andfeature enhancement are well known, the present description will bedirected in particular to attributes forming part of, or cooperatingmore directly with, method and system in accordance with the presentinvention. Attributes not specifically shown or described herein may beselected from those known in the art. In the following description, apreferred embodiment of the present invention would ordinarily beimplemented as a software program, although those skilled in the artwill readily recognize that the equivalent of such software may also beconstructed in hardware. Given the system as described according to theinvention in the following materials, software not specifically shown,suggested or described herein that is useful for implementation of theinvention is conventional and within the ordinary skill in such arts. Asa matter of nomenclature, in the description of the present invention,there is reference to enhancement filters as methods that enhance thevisual appearance of a face in a digital image. For example, an eyeenhancement filter is a method of enhancing the whiteness and/or iriscolor of the eye.

If the invention is implemented as a computer program, the program maybe stored in conventional computer readable storage medium, which maycomprise, for example; magnetic storage media such as a magnetic disk(such as a floppy disk or a hard drive) or magnetic tape; opticalstorage media such as an optical disc, optical tape, or machine readablebar code; solid state electronic storage devices such as random accessmemory (RAM), or read only memory (ROM); or any other physical device ormedium employed to store a computer program.

FIG. 1A illustrates a system 10 that is useful in practicing the presentinvention. The system 10 includes a personal computer PC 12 containing acentral processing unit (CPU) that can execute a set of predefined stepsin carrying out the method of the present invention. A digital storagemedia 20 is also provided in connection with PC 12 for storing digitalimages. The digital storage media 20 can include different types ofdevices, such as RAM, ROM, hard and floppy drives, etc. The digitalstorage media 20 can also be used to locally store the generatedenhanced images. In addition, digital image capture devices such as ascanner 28 and a digital camera 30, which are additional sources ofdigital images, can also be provided to the computer 12. However, it isto be understood that the digital images may be obtained from anysource. A user interacts with the computer 12 via input devices 40, suchas a mouse and/or keyboard, and a display monitor 50 that is connectedto the computer 12. The system 10 may also contain a device such as aprinter 34 for locally outputting the images. Typically, the abovecomponents would reside on, in the sense of being directly connected to,the PC 12.

Alternatively, the above components do not have to all reside on thehost computer 12 but can reside on a server 62 that can be connected toa client PC 12 via a communication network 70. The server may alsocontain a central processing unit (CPU) that can execute a set ofpredefined steps in carrying out the method of the present invention.The server may also be connected to a storage media 65 and one or moreprinters 60. This can enable images to be remotely acquired, stored andprinted via the communication network 70 using the storage media 65 andprinter 60 connected to the server 62. The software for carrying out thepresent invention is typically stored on storage media 20.Alternatively, this software can be downloaded from the server via thecommunication network 70. The software for carrying out the presentinvention can be executed either on the client using the CPU containedin the PC 12 or on the server side using the CPU contained in the server62. The communication network 70 may comprise a private network, such asa local area network (LAN), or a public network, such as the Internetthat can be accessed by an individual using an Internet Service Provider(ISP). As is customary in such networks, the remote network serviceprovider may also be accessed by a customer using a retail kiosk or anyother appropriate communication device.

FIG. 1B shows an example of Graphic User Interface (GUI) for theinteractive software that carries out the present invention; thesoftware runs locally on the system 10 or remotely on the server 62, andproduces a GUI screen 78 as shown in FIG. 1B. The user launches thesoftware and downloads an image to be enhanced. When the image isdownloaded, the Graphic User Interface screen 78 is displayed on thedisplay 50. An image 80 on the left of the GUI screen 78 is the originaldownloaded image with the face to be enhanced by the method of thepresent invention. On the right, an image 82 with the enhanced face ispresented. In one embodiment, when the image is downloaded, the userclicks on the eyes of the face 80 to be enhanced. In response, as willbe described in detail later, the system automatically finds facialfeature points and segments the face into different features (e.g.,eyes, eyebrows, etc.) and a neck region. The system sets up defaultparameters and applies all enhancement filters in a predefined order tothe original image.

The resulting image 82 is displayed on the right side of the GUI screen78. The sliders 90, 92, 94, 96 and 98 allow the user to interactivelychange parameters of different enhancement filters. The initialpositions of the sliders correspond to the default values set upautomatically by the system. The main appearance enhancer slider 90combines all component enhancement sliders. The component slidersinclude a texture enhancer slider 92, a skin enhancer slider 94, an eyeenhancer slider 96 and a teeth enhancer slider 98. The textureenhancement slider 92 controls parameters of the texture enhancementfilter. The skin enhancer slider 94 controls parameters of the skin toneenhancement filter. The eye enhancer slider 96 and the teeth enhancerslider 98 control parameters of the eye and teeth whitening filters,respectively. All the enhancement filters are described in detail in thefollowing sections. The minimum and maximum for all sliders are set upto “no enhancement” (e.g., at the left extreme of each slider) and to“maximum enhancement” (e.g., at the right extreme of each slider),respectively.

The user can control the level and look of facial enhancement by usingthe one global appearance enhancer slider 90 or the separate componentsliders 92-98. Whenever the user changes a position of the mainappearance enhancer slider 90, the system maps the position of theslider into appropriate parameter values of the enhancement filters andapplies all the enhancement filters in the predefined order to theoriginal image. The enhanced image 82 is then displayed on the rightside of the GUI screen 78. Whenever the user changes one of thecomponent enhancer sliders 92-98, the system applies all enhancementfilters to the original image in the predefined order based on thepositions of each component enhancer slider. The enhanced image 82 isthen displayed on the right side of the GUI screen 78. Part of the GUIdesign in the preferred embodiment is the option of modifying facialfeature points and a neck region outline. When the user selects thatoption from the menu “Edit” pulled down from the top bar of the GUIscreen 78, the facial feature points and neck region outline points areoverlaid on the original image 80 and the user can modify location ofthe displayed points by using the user input device 40, such as apointing device. The tool bar 84 contains specific tools the user canuse to interact with and modify the displayed images. For example a toolfor zooming in and out, a tool for editing feature points, a blendingtool to locally blend the original image with the enhanced image, a toolfor spatially modifying the results of an enhancement filter, etc.

FIG. 2A is a schematic flowchart illustrating one embodiment of themethod of enhancing a portrait image according to the present invention.After initiating the process in step 200, a digital image is acquired bythe system and then displayed on the display monitor 50 in anacquisition and display step 205. In the present invention, a digitalimage refers not only to images obtained from photographs, but todigital images obtained without limitation from any source, for example,from a digital camera, scanning of a hardcopy image, or electronicallyfrom another source. In a locate step 210, the individual faces in theimage are detected and the location of the facial feature points on eachface are identified. The process of locating the faces and theirassociated feature points can be performed manually by the user, orsemi-automatically or automatically using image processing techniques.The locations of the facial feature points are used to identify andsegment different regions of the face (such as skin, eyes, nose, mouth,hair, etc.) and the neck region. In a display step 215, the facialfeature points are overlaid on the image and displayed on the displaymonitor 50. Optionally, feature points outlining the neck region aredisplayed as well. If the facial feature points were determinedautomatically or semi-automatically, the user at a decision step 220 hasan opportunity to decide if the feature points need to be adjusted. Ifthe user decides that the feature points need to be adjusted, at amodify step 225 the user can adjust the facial feature points using theinput device 40. Optionally, the user can adjust feature pointsoutlining the neck region as well.

At a default setup step 230 the system uses the location of the facialfeature points to identify and segment different regions of the face,such as skin, eyes, nose, mouth, hair, facial hair, etc., and determinethe appropriate default parameters for the enhancement filters. In thepreferred embodiment the neck region is automatically segmented based onlocation of facial feature points. The method of segmenting a neckregion will be described in detail later. Accordingly, in step 230 thesystem determines the appropriate default parameters for enhancementfilters for the neck region as well. Optionally, at this stage thegender and age of the face can be determined manually or automaticallyusing gender and age classification algorithms. An example of automaticgender classification is described in B. Moghaddam and M. H. Yang,“Gender Classification with Support Vector Machines” in Proc. of 4^(th)IEEE Int'l Conf. On Face & Gesture Recognition, March 2000, which isincorporated herein by reference. Typical algorithms for ageclassification operate by performing an analysis of a digital image of asubject's face for particular detailed facial features such as facialfeature ratios and wrinkle analysis. An automatic age classifieralgorithm useful for the practice of the present invention is disclosedin U.S. Pat. No. 5,781,650 to Lobo and Kwon, which is incorporatedherein by reference. Gender and age classification can be used to decideon which enhancement filters should be executed along with genderspecific parameters. For example, as a default a larger amount oftexture and skin enhancement can be applied to female faces than to malefaces. The preferred default parameters can be determined based on animage class as well. An image class is a class of images similar interms of type (e.g. portrait), content (e.g. family portrait or schoolportrait), resolution and composition. A user can, e.g., check imageclass by pulling down the “Edit” menu from the top bar of the GUI screen78 (FIG. 1B), and checking a “Preferences” submenu for a listing ofexemplary image classes.

The system then executes the enhancement filters in an execution step235 using the appropriately chosen parameters. Alternatively, as shownby broken line, the user at a user selection step 240 can decide whichenhancement filters should be executed along with the appropriateparameters for the enhancement filters. After the system finishesexecuting the enhancement filters in the step 235 the enhanced image isdisplayed in a display 245 on the display monitor 50. At this point theuser can decide if the enhanced image is acceptable. If the image is notacceptable, the user can choose either to change the enhancement filtersand/or their parameters in the user selection step 240 or adjust thelocation of the facial feature points in the modify step 225. In oneembodiment, the user can choose to sequentially execute differentenhancement filters to see the effect a given enhancement filter has onthe image. In this embodiment, the user will cycle through steps 240,235, 245, 250 changing the enhancement filters and parameters until anacceptable result is obtained. If the enhanced image is deemedacceptable in a decision step 250, the user can chose either to locallyprint in a local print step 255 on the printer 34 or locally archive ina local archive step 260 on storage media 20. Alternatively, if thesystem is connected to a server 62 via a communication link 70, the usercan also choose either to remotely print in a remote print step 265 onthe printer 60 or remotely archive in a remote archive step 270 onstorage media 65. After the appropriate action has been chosen andcompleted, the system queries for the presence of a new image (querystep 275) and depending on the response, cycles back to the acquire anddisplay step 205 for the next image or ends the process (ending step280).

FIG. 2B shows an alternative embodiment of enhancing a portrait imageaccording to the present invention that is more conducive for highlyautomated and efficient production at a commercial photographicestablishment. This embodiment describes an automatic batch process forrunning a large number of images through the portrait enhancement systemwithout the necessity of user intervention. At an acquisition step 282,an image is acquired from a script file (computer file) that containsthe names and locations of images that have been selected to beenhanced. The script file can also contain additional instructions thatcan be used to control the batch process. For example, the script cancontain not only the location and name of the image but it also cancontain instructions on what to name and where to store the enhancedimage and also whether to delete the original image after generating theenhanced image. A diverse instruction set enables a flexible batchprocess that can be easily utilized by various commercial photographylabs to fit their specific workflow schemes (see below). At a facedetection and location step 284, the faces in the image areautomatically detected and the locations of the facial feature points oneach face are automatically identified. In an enhancement selection step286, the system characterizes the face and determines the appropriateensemble of enhancement filters and default parameters for theenhancement filters. Optionally, at this stage the gender and age of theface can be determined automatically using gender and age classificationalgorithms (as described hereinbefore).

Alternatively, the age and gender of the faces in the image can besupplied to the system via metadata associated with the image, e.g., theage and gender can be supplied from a customer-supplied photofinishingenvelope or by otherwise querying the user. The default filters andparameters can also be supplied as image dependent metadata or as animage independent setting before the process of enhancement isimplemented. The metadata can be directly incorporated into the imagefile or it can be obtained from the script file. FIG. 2C shows anexample of a script file use to control the automatic batch processaccording to the present invention.

The system then executes the ensemble of enhancement filters in anenhancement execution step 288 using the appropriately chosenparameters. If there is more than one face in the image, this fact isnoted in the face query step 290 and the system iterates through steps286, 288, and 290 until all faces in the image are enhanced. During thistime, intermediate images may be created containing image information(i.e. masks, feature maps, feature points, etc.) produced in aparticular step for use in that or a subsequent step. At a storage step292 the enhanced image is stored. In addition to storing the enhancedimage, an output script file (as described below), and the intermediateimages (as described above) can also be stored. The process of enhancingthe images is continued until all the input images have been enhanced(image query step 294). After all the images have been processed (endingstep 296), the enhanced images may be applied to the utilization stages255-270 shown in FIG. 2A. Optionally, after all the images have beenprocessed (ending step 296), the enhanced images can then be broughtinto the user interactive system, such as described in FIGS. 2A, 2D and2E, to be checked for the acceptability of the enhanced image and, ifneeded, modified before the utilization stage (steps 255-270 in FIG.2A).

FIG. 2D shows an embodiment for checking the acceptability of enhancedportrait images generated by batch processing according to the presentinvention. Commercial photo labs have very tight time demands in orderto handle the vast number of images that are processed through theselabs. Thus the user interactive system has to efficiently and optimallyintegrate with the output of the batch system so that the batchprocessed images can be rapidly reviewed and if needed modified so as tomeet the productivity demands of commercial labs. To facilitate thisneed, an output script file is generated from the batch process for eachprocessed image. The script file contains information describing theoperations performed on the image and where the original, enhanced, andintermediate images are stored and also additional instructions for theinteractive system on what to do with the original, enhanced, andintermediate images upon the acceptance or rejection of the enhancedimage. Alternatively, the data within the output script or the locationof the output script can be stored inside the image file as metadata. Atan acquisition step 2000, the original, enhanced, and intermediateimages are acquired using the data contained within the output scriptfiles or from the metadata contained within the image. The location ofthe output script file or image can be acquired from a script file thatcontains the names and location of output script files or images thathave been processed by the batch system. At a display step 2010, theoriginal and enhanced images are displayed side by side on the displaymonitor 50. At an accept/reject decision step 2020, the user decideseither to accept or reject the batch system-generated enhanced image,by, e.g., clicking on either the accept or reject buttons. If theenhanced image is rejected, the user enters into an interactiveretouching mode step 2030 where the user iterates through steps 286,288, and 290 (FIG. 2B) until all faces in the image are enhanced (to theusers). If available, the intermediate images (i.e. masks, feature maps,feature points, etc.) can be used to enable the rapid modification ofenhanced images that are deemed unacceptable. The use of theintermediate images alleviate the need to carryout time consumingcalculations (recalculate them) when applying the enhancement filters.At an accept/reject decision step 2040, the user decides whether toaccept or reject the newly enhanced image. At a cleanup step 2050, thesystem executes the instruction in the output script file dealing withthe fate of the original, enhanced, and intermediate images. As soon asthe current image is accepted/rejected the next image on the list alongwith its enhanced image are immediately displayed so as to enable theoperator to make a rapid decision on the acceptability of the enhancedimage. The process of checking batch process-enhanced images iscontinued until all the images have been checked (query step 2060).

To further improve the productivity of the batch/interactive system, thebatch system can automatically flag enhanced images that may requireuser attention. These flags can be used by the system to limit thenumber of enhanced images that have to be checked using the interactivesystem. The flags can represent a probability of the acceptability ofthe enhanced image and/or a textual description of the state of theenhanced image. For example, if at face detection and location step 284,the system fails to find a face, the system can flag the image with 0.00acceptability flag along with a “No Face Found” flag. In anotherexample, the system can flag the image with an acceptability flagproportional to the amount of skin texture enhancing performed on theimage. The more the skin texture is enhanced the lower the acceptabilityflag. In another example, if the system determines that the face has abeard, a “Facial Hair” flag can be set or if the person is wearingglasses, a “Glasses” flag is set. If desired, only images withacceptability probabilities lower than a specified threshold and/orimages with specific textual flags will be acquired and opened at step2000 and high probability images will be skipped. It should be clear toone of ordinary skill in this art that there exist many otheralternative embodiments of batch/interactive systems useful inpracticing the current invention for high volume commercial photo labs.

The portrait enhancement system embodiment described in FIG. 2 a can beimplemented on a consumer operated image fulfillment kiosk. The consumerif so desired can manually initiate the portrait enhancement system.FIG. 2 e shows an alternative embodiment of enhancing a portrait imageaccording to the present invention that is more conducive for consumeroperated kiosks for generating prints from prints, negatives, digitalfiles, etc. This embodiment describes a semi-automatic/automatic processfor determining the suitability of an image to be enhanced and forapplying the portrait enhancement to the image with or without userinvolvement. After the consumer initiates the fulfillment process instep 2100, a digital image is acquired by the system in acquisition step2105. The image is acquired by scanning either a photo or a negative, orfrom a file contained on digital media, or from a file on a network ifthe system is connected to a server via a communication link. At facedetection step 2110, the faces in the image are automatically detectedbefore the acquired image is displayed to the consumer and if a face(s)is found the locations of the facial feature points on each face areautomatically identified. At decision step 2120, if no faces are foundin the image or if none of the detected faces are suitable forenhancement, the acquired image is displayed 2180 and the user continueson using the conventional image fulfillment kiosk processing 2190. Therecan be numerous criteria used to determine whether a face is deemedacceptable for enhancement. In a preferred embodiment, the size andsharpness of the face are used to measure whether the face is suitablefor enhancement. In order to realize the benefits of enhancing the face,the face must be large enough and sufficiently in focus for the user tosee the improvements. If a face(s) is detected that is deemed acceptablefor enhancement the system then executes the appropriate enhancementfilters in an execution step 2130 using the appropriately chosenparameters. After the system finishes executing the enhancement filtersin the step 2130 the enhanced image is displayed 2140. In a usernonintervention mode the user continues on to use the image fulfillmentkiosk processing 2190. In a user intervention mode, the user can decideif the enhanced image is acceptable. If at decision step 2150 the imageis acceptable to the user, the user continues on using the imagefulfillment kiosk processing 2190. Otherwise if the image is notacceptable, the user can choose at decision step 2160 either to bypassthe enhancement stage and continue on using the kiosk processing 2190 orhave the interactive version of the portrait system launched. At thispoint the GUI of the interactive portrait system (FIG. 1 b) is displayed2170 and the consumer can then use the interactive version to enhancethe image until an acceptable result is obtained.

FIG. 3 is a flowchart for the facial detection and point location step210 of FIGS. 2A and 2B, showing the process of locating the salientfacial feature points on the faces present in the image according to thepresent invention. A face detection module 310 is applied to the digitalimage to mark the locations and rough sizes of all human faces presentin the image, and a facial feature detector 315 locates the salientfacial feature points on the detected faces. The face detection step canbe performed manually by the user or automatically using one of thenumerous face detection methodologies that have been recorded in theacademic literature. A preferred automatic face detection method forthis application consists of methods described in Henry Schneiderman, AStatistical Model for 3D Object Detection Applied to Faces and Cars,Ph.D. Thesis, Robotics Institute, Carnegie Mellon University, May 2000,which is incorporated herein by reference. Alternatively, if a manualapproach is used to detect faces a preferred method is for the user toclick on both eyes of one or more of the faces present in the image. Thespatial separation of the eyes can be used to estimate the size of theface.

Following detection of one or more faces, the image coordinates andestimated size of each face are in turn provided to the facial featuredetector 315, which has the task of locating the salient facial featurepoints on the detected faces. In the preferred embodiment, an activeshape model is used as the facial feature detector. The active shapemodel is described in A. Lanitis, C. J. Taylor, and T. F. Cootes,“Automatic interpretation and coding of face images using flexiblemodels,” IEEE Trans. on PAMI, Vol. 19, No. 7, pp 743-756, 1997, which isincorporated herein by reference. The detected feature points are usedto identify, outline, and segment different regions of the face, such asthe facial skin region, eyes, nose, mouth, eyebrows, hair, facial hair,etc., and a neck region. The detected regions are identified by thecorresponding binary masks. The binary masks of the regions are thenspatially feathered to generate alpha masks. The alpha masks are used instep 235 and 288 to blend the results of the enhancement filter (e.g.texture enhancement filter) with the original image. Feathering binarymasks and applying the resulting alpha masks in blending operationensure smooth transition between regions that have and have not beenenhanced. To generate alpha masks the binary masks are feathered byblurring the binary masks with a blurring function where the blur radiusis chosen based upon the size of the face. The binary masks are used todetermine where to spatially apply the enhancement filters as shown inFIG. 2A and FIG. 2B.

Referring to FIG. 4, there is shown an visual example of the location ofsalient feature points 420 on a detected face 410. Typically thesefacial feature points are located either manually or automatically usingimage processing techniques.

In many images it is critical to apply the skin enhancement filters notonly to the face region but also to the neck region. In a presentlypreferred embodiment, the neck region is determined by combining amodified generic neck shape model with a skin color classifier. The flowchart for the method of determining neck region is shown in FIG. 5A. Ina generic mapping step 550, a generic probability map for a neck regionis created. A generic neck probability map is based upon a prioriknowledge of the shape of the neck. In the preferred embodiment, ageneric probability map is created by averaging a sample population ofnormalized images that represent an anticipated population of images tobe enhanced (e.g. portrait type images). The sample images arenormalized by scaling each image to the same predefined location of theeyes. In each sample image, a neck region is outlined manually. Thefinal neck probability for each pixel is an average sum of a scoringfunction equal to 1 if a given pixel is a part of neck region and 0otherwise for all sample images. A generic neck probability map can becreated using heuristic approximation. If a gender of a person in theimage is known, a different probability map is used for men and women inthe preferred embodiment. Usually, a skin region is more visible inportraits of women than of men. In a scaling step 554, a generic neckprobability map is scaled to fit individual feature points of the chinline and the face outline.

In a skin color classification step 556, a neck probability map iscreated based on color segmentation. A supervised pixel-based colorclassifier is employed to mark all pixels that are within a specifieddistance of skin color. The pixel-based color classifier, which is aconditional probability function of pixel color C belonging to skin, ismodeled as a Gaussian, $\begin{matrix}{{p\left( {C\text{❘}{skin}} \right)} = {\frac{1}{2\pi{\sum\limits_{skin}}^{1/2}}{\exp\left\lbrack {{- \frac{1}{2}}\left( {C - \mu_{skin}} \right)^{T}{\sum\limits_{skin}^{- 1}\left( {C - \mu_{skin}} \right)}} \right\rbrack}}} & \left( {{EQ}.\quad 1} \right)\end{matrix}$where mean vector μ and the covariance matrix Σ are estimated from thedefined skin region. The vector C corresponds to the pixel's red (R),green (G), and blue (B) signal. The above approach is also applicablewhen C is represented in other color spaces, e.g., CIELAB, YUV, HSV,etc. A subset of the facial skin region is used to determine aconditional skin probability distribution. In a presently preferredembodiment the skin region above the eyes and skin regions where facialhair is detected are excluded from use in estimating the mean vector μand the covariance matrix Σ in equation EQ. 1. The neck probability isdefined according to equation EQ. 1 for all pixels outside the faceregion and below the chin line, and is equal to 0 otherwise.

In a final map generation step 558, the final probability map is createdby combining the scaled generic neck probability map and the skin colorbased probability map. In the preferred embodiment, two probability mapsare arithmetically multiplied. The resulting neck probability map isused as an alpha channel to determine how to blend the results of theenhancement filters with the original image. The binary neck region maskis created by thresholding the final neck probability map. If theprobability is greater than 0 for a given pixel, the corresponding maskvalue is equal to 1 thereby indicating the neck region, otherwise themask value is equal to 0 thereby indicating a non-neck region. Thebinary neck region mask is used to determine where to apply theenhancement filters.

FIG. 5B-5D demonstrate visually the process of creating the final neckprobability map. Referring to FIG. 5B, a scaled generic neck probabilitymap is shown. A generic probability map is scaled to match theindividual feature points outlining the face. A generic neck probabilitymap is based on a priori knowledge of neck location relative to theoutline of the face as described in the previous section. The genericneck probability shown in FIG. 5B is one possible example based onheuristic rules rather than statistical analysis recommended in theprevious section. It serves the purpose of demonstrating qualitativecharacteristics of the process. A central region 570 within the genericmask has high values (e.g. greater than 0.5 and less than or equal to 1)corresponding to the high probability of the neck region. A borderregion 572 has lower values (e.g. greater than 0 less than 0.5)corresponding to the lower probability of the neck region. Theprobability of the neck region tapers off to a value of 0 outside theregion 572. In general, the probability decreases in a continuous mannerfrom the center of the region 570 to the edges of the region 572 in ahorizontal direction and from top to bottom in a vertical direction. Thecentral region of the mask that is right below the chin line has thelargest probability associated with it.

An outline 574 of the neck probability map determined by a skin colorclassifier is shown in FIG. 5C. The skin color based probability iscalculated according to the equation EQ. 1 as described in the previoussection. The probability values outside the outlined region 574 areequal to 0. The probability values within the region 574 are greaterthan 0, as defined by equation EQ. 1. The two neck probability maps: thescaled generic neck probability map and the neck probability map basedon skin color classification are combined by arithmetic multiplicationof the two. The outline of the resulting final neck probability map isshown in FIG. 5D. The central region 576 corresponds to the highprobability region 570 cropped by the skin color probability region 574.The region 578 corresponds to the low probability region 572 cropped bythe skin color probability region 574.

Once the facial feature points and neck region have been located, anensemble (i.e., two or more) of appearance enhancement filters can beapplied to the face and neck regions in the image. Referring to FIG. 6,several different enhancement filters are shown. In the preferredembodiment, the following enhancement filters are implemented: a skintexture enhancement filter 610, a skin tone enhancement filter 620, ateeth enhancement filter 630, an eye enhancement filter 640, and afacial feature shape enhancement filter 650. All these filters aredescribed in detail in the following sections of the specification. Theenhancement filters can be applied in any order. In one embodiment, theuser can select any of the enhancement filters in any order he/she wantsto apply them to the faces and neck regions in the image. However, inthe preferred embodiment, the system sets a default order of applyingenhancement filters together with the appropriate parameters.

If the user elects to run default settings, then all enhancement filtersare applied in the default order with the default parameters and theenhanced image is displayed on the monitor. The default order ofenhancement filters is as follows: the skin texture enhancement filter,the skin tone enhancement filter, the teeth and eye whitening filter (ineither order), and the facial feature shape enhancement filter. Theenhancement filters are described in the next sections in the same orderas the default order of applying filters to the original image.

Some of the default parameters may be dependent on the class of images,where the class is based on a category of subject matter. For example, aset of default parameters may be optimized for categories such as schoolportrait images, family portrait images, baby pictures, and so on. Inone of the embodiments, when running the system in a batch mode, theoperator may either specify, in the control script, file parameters foreach filter or just specify the class of images. When a class of imagesis specified then the preferred set of parameters for a given class isused. In a similar manner, for an interactive software embodiment of thepresent invention a user may select a class of images from thepreference menu and the default settings will be set up automaticallyfor the enhancement filters.

When enhancement filters that change skin appearance (e.g. skin textureenhancement filter) are applied, it is usually important to mask offhair and facial hair. Otherwise, artifacts such as lack of hair texturemay be very noticeable in the resulting image. The feature pointsdetermined by the feature finder algorithm usually do not preciselyoutline precisely highly variable features such as the hair line, whichis irregular and widely varies from face to face. In the preferredembodiment, a refinement step is added to mask off hair overlapping withthe forehead skin region. Referring to FIG. 6B, a flowchart for refininga hairline mask is shown. In step 670, the forehead bounding region isdefined. The bounding region is determined based on detected featurepoints (eyes location) and maximum possible size of the forehead knownfrom a priori knowledge of human anatomy. In step 672, different featureprobability maps are created within the forehead bounding region. Thefeature probability maps include texture information and colorinformation derived from the original image. In the preferredembodiment, directional edge maps are created for horizontal, verticaland diagonal directions. The directional edge detectors used forcreating texture maps are described in detail in the following sectionon texture enhancement. In one preferred embodiment, the textureprobability map is created in the following steps. First, the verticaledge gradient is calculated as described in the texture enhancementsection. The vertical edge detector kernel size depends on the eyeseparation distance. In the second step, a connected component map iscreated for all the vertical edges with a gradient magnitude greaterthan a specified threshold. In the next step the normalized connectedcomponent density is calculated according to equations Eqs. 2 and 3.$\begin{matrix}{{d\left( {x,y} \right)} = {\sum\limits_{m = {x - k}}^{x + k}{\sum\limits_{n = {y - k}}^{y + k}{w_{m,n}{C\left( {m,n} \right)}}}}} & \left( {{EQ}.\quad 2} \right) \\{{\overset{\_}{d}\quad\left( {x,y} \right)} = \frac{\mathbb{d}\left( {x,y} \right)}{\mathbb{d}_{\max}}} & \left( {{EQ}.\quad 3} \right)\end{matrix}$where d(x,y) is the connected component density at pixel (x,y)calculated within a region (2k+1)·(2k+1) centered around pixel (x,y),w_(m,n) is a weighting factor based on the distance to pixel (x,y),C(m,n) is the size of the connected component that pixel (m,n) belongsto, d_(max) is the maximum value of d(x,y) in the region of interest,{overscore (d)}(x,y) is the normalized connected component density atpixel (x,y).

Next, the normalized connected component density values are thresholded.If less than a specified threshold (e.g. 0.3) the density value is setto 0 otherwise it is preserved. The thresholded normalized connectedcomponent density map can be used as a hair texture probability map. Theedge detector kernel size depends on the eye separation distance. Theskin color probability map may be created using the same approach asdescribed for the neck color probability map in the previous section. Instep 674, probability maps are combined by normalized weighted sum ofprobabilities. The final probability map is combined with the originalface alpha channel as the new alpha channel map used for blending. Thesame technique can be used for facial hair. Instead of defining thebounding box for the forehead in step 670, the region of interest isdefined for beard and/or moustache based on facial feature pointsdetermined by the feature finder algorithm. Then the feature probabilitymaps are created for the particular regions of interest. If the genderis known beforehand, the facial hair masking can be enabled for men anddisabled for women. This can increase the overall speed of the systemand eliminate artifacts that may be created due to falsely detectedfacial hair.

It is important in the embodiment of the present invention that theenhancements applied to the face do not create or increase asymmetricallook of the face. For example, some symmetric characteristic skinfeatures like laugh lines or lines under eyes if removed should beremoved on both sides of the face or if enhanced should be enhanced in aproportional and symmetrical way. When relevant, the symmetry issue isaddressed specifically for each enhancement filter in the followingsections.

Texture Enhancing Filter.

The task of the skin texture enhancing filter is to smooth the localtexture of the skin, remove blemishes, dark spots, etc. and to eitherremove or lessen the extent and deepness of wrinkles. Referring to FIG.7A, there is shown a flowchart for a skin texture enhancing filteraccording to the present invention. In a skin feature generation step710, the skin features that are within the skin region delineated by thefacial feature points are detected. Then the detected skin features aremodified in a feature modification step 720. Skin feature map containsfeatures that we wish to modify, such as blemishes, dark spots,wrinkles, etc.

In the prior art, color analysis is used to locate specific skindefects. Also in the prior art, the detection of skin defects isperformed by analyzing the histogram of the color signals associatedwith the pixels contained within a finite 2-dimensional window that isslid over the skin region. A region is considered to contain a skindefect if its associated histogram is found to be bimodal. Since thesetechniques use color information as part of their primary detectionmeans, it requires that the imaging system be color calibrated and/orthe image to be analyzed be correctly color balanced. The efficacy ofusing color information is enhanced when controlled lighting and/orcolored filters are used to capture the images. In addition, accuratecolor reproduction is needed if the detected defects are going to befurther classified as blemishes, brown spots, etc based on the color ofthe defect.

In photographs, the skin imperfections such as wrinkles, blemishes, etcmanifest themselves as (are really just) highlights and shadows inplaces where they should not be. The skin imperfections thus correspondto local intensity maxima and minima. The highlights correspond to peaksand the shadows correspond to valleys in the luminance image. In adeparture from the prior art, and according to a preferred embodiment ofthe current invention, skin imperfections are detected by applying peakand valley detectors to the luminance image formed from the componentRGB signals. Valley/peak detectors are second difference operators. Theluminance is defined as a weighted linear combination of the red R,green G, and blue B signals, as follows,L=k1R+k2G+k3B  (EQ. 4)where k values represent the weights. A presently preferred choice ofweights for generating the luminance image is k1=k2=k3=0.333. Examplesof valley/peak operators can be found in D. E. Pearson and J. A.Robinson, “Visual Communication at Very Low Data Rates,” Proceedings ofthe IEEE, Vol. 73, No. 4, April 1985.

A presently preferred peak/valley operator is a series of fourdirectional operators of the type employed by Pearson et al. A verticaloperator V, which is applied to the middle pixel m in the 5×5neighborhood of pixels shown in FIG. 7B, where the pixel locations aredesignated a through y, is defined by equation EQ. 5, as follows,V=f+k+p+j+o+t−2(h+m+r)  (EQ. 5)This operator is applied at each pixel location in the delineated skinregion. Similarly, a horizontal operator H of the form shown in equationEQ. 6 and a pair of right and left diagonal operators DL and DR as shownin equations EQ. 7 and EQ. 8. Respectively, are applied at each pixellocation in the delineated skin region, as follows,H=b+c+d+v+w+x−2(l+m+n)  (EQ. 6)DR=c+g+k+o+s+w−2(i+m+q)  (EQ. 7)DL=c+i+o+k+q+w−2(g+m+s)  (EQ. 8)These operators not only detect valleys/peaks, but they also have asecondary response to the feet/shoulder of edges. Thus they are referredto as valedge/peakedge detectors. Valedge features correspond topositive values of the operator's output whereas peakedge featurescorrespond to negative values. A valley/peak detector that is sensitiveonly to valleys/peaks is obtained by applying logical conditions tooperators. For vertical valleys the logical valley detectorcorrespondence is given by:if(f+k+p)>(h+m+r)and(j+o+t)>(h+m+r) then V=(f+k+p+j+o+t)−2(h+m+r) elseV=0  (EQ. 9)For vertical peaks the logical peak detector correspondence is given by:if(f+k+p)<(h+m+r)and(j+o+t)<(h+m+r) then V=(f+k+p+j+o+t)−2(h+m+r) elseV=0  (EQ. 10)Logical detectors for a horizontal and diagonal valleys/peaks havesimilar form.

Both valley/peak and valedge/peakedge operators are effective forgenerating the skin feature map according to the present invention. Fromthis point on we use the term valley/peak operators to refer both tovalley/peak and valedge/peakedge operators.

Prior to applying the oriented valley/peak filters to the image, theeffects of noise in the image are suppressed by applying a noisereduction filter. Appropriate noise filters are low pass filters, medianfilters, and other linear and non-linear filters commonly employed toreduce noise in digital images.

The oriented valley/peak images generated by the operators arethresholded so as to retain only (strong) relevant skin features. Forvalley feature maps, pixels with values less than a specified thresholdT_(v) are set to zero. For peak feature maps, pixels with values greaterthan a specified threshold T_(p) are set to zero. The threshold can beeither a fixed global threshold or an adaptive threshold. A presentlypreferred threshold method is to use an adaptive threshold whose valueis given by equation EQ. 11.T=αL_(avg)  (EQ. 11)where β is a constant and L_(avg) is the local average luminance aboutthe pixel. Different values of β can be used for the vertical,horizontal, and diagonal components. The local average luminance L_(avg)may be the value of the pixel itself or the average luminance of aneighborhood of pixels, for example a 3×3 neighborhood of pixels.

A presently preferred step is to generate a combined skin feature map Fby combining the individual oriented feature maps.F=max {H, V, DR, DL}  (EQ. 12)Additionally, each pixel in F can be labeled according to which orientedfilter it originated from. The oriented label data and/or the individualoriented skin feature maps can be useful in removing features such aswrinkles where features of a particular orientation are preferentiallyremoved.

The task of the skin texture enhancing filter is to smooth the localtexture of the skin. The spatial size of the skin texture that the skintexture enhancing filter smoothes is a function of the size of the face.Thus in order to detect the appropriate skin features the spatial sizeof the valley/peak filters is adaptively determined based upon the sizeof the face. In addition, the type of valley/peak filter (directional,isotropic, etc.) can also be adaptively selected based upon the size ofthe face. Specifically, the separation between the eyes is used todetermine the size and type of valley/peak filter. One genericrepresentation for the vertical valley/peak operator is $\begin{matrix}{{V\left( {x,y} \right)} = {{\frac{1}{2h}{\sum\limits_{i = {- h}}^{h}{I\left( {{x - w},{y + i}} \right)}}} - {2{I\left( {x,{y + i}} \right)}} + {I\left( {{x + w},{y + i}} \right)}}} & \left( {{EQ}.\quad 13} \right)\end{matrix}$where w and h are chosen as a function of the face size. Genericvalley/peak detectors for a horizontal and diagonal valleys/peaks have asimilar form.

A presently preferred isotropic valley/peak detector is given bysubtracting the blurred luminance image I_(b) from the luminance image IF(x,y)=I(x,y)−I _(b)(x,y)  (EQ. 14)The blurred luminance image can be generated by applying a blur filtersuch as a Gaussian or a box filter to the luminance image. The output ofthe valley/peak detector is thresholded as described above to generatepeak and valley feature maps. The radius of the blur filter is chosen asa function of the face size (which is an example of a default parameter)and the size of the skin feature that one wishes to detect.

The feature maps are further refined by grouping pixels that areconnected to each other via connected component labeling. Connectedcomponent labeling scans an image and groups its pixels into componentsbased on pixel connectivity, i.e., all pixels in a connected componentare in some way connected with each other. Once all groups have beendetermined, each pixel is labeled according to the component it wasassigned to. Each connected component corresponds to a skin feature.Each skin feature is characterized and classified by its feature-basedcharacteristics such as size, shape, and location in the skin region.The size corresponds to the number of pixels in the component (which isan example of a default parameter). Shape information describes specificcharacteristics regarding the geometry of a skin feature. Examples ofshape information are spatial moments, bounding boxes, orientation,principal axes, etc. Additional information on shape analysis can befound in William S. Pratt, Digital Image Processing, 2nd edition, JohnWiley & Sons, 1991. In addition, the features delineated in the skinfeature map can be further classified using the color informationassociated with the pixels that have been identified as skin features.Shape and color information is useful in delineating higher orderfeatures, such as wrinkles, blemishes, beauty marks, moles, shadows,highlights, and so on. Once the skin feature maps are generated they areused to select the skin features that are going to be modified in step720.

Referring to FIG. 8, there is shown a flow chart illustrating apreferred embodiment of selecting and modifying skin features accordingto the present invention. In a feature selection step 810, features tobe modified are selected based on their characteristics. As mentionedabove, the feature characteristics correspond to the size, shape, andcolor and are selected based upon the location of these features in theskin region. The selection of skin features has to take into accountsymmetry considerations as well. Some skin features are symmetrical withregards to right and left side of the face. Selecting and modifying somedistinctive skin feature only on one side of the face may createasymmetry that can be perceived as an artifact. One example may be skincreases under the eyes or the prominent nasolabial creases (laugh lines)that are strongly visible when one is smiling. In the preferredembodiment, these symmetric features are identified automatically basedon their characteristics (e.g. location, shape, color, etc). When one ofthese symmetric features is selected for enhancement, e.g., based on itssize or/and other characteristic, than the corresponding symmetricfeature on the other side of the face is selected automatically as wellregardless of its characteristics to ensure symmetry of the resultingenhancement.

Which symmetric skin features are always excluded from the selection andenhancement and which ones are eligible for selection depends on thedesired look of enhancement. This may be determined based on the age orgender. In another embodiment, some symmetric skin feature may require aunique type of enhancement.

In a dilation step 820, the selected skin features are then (adaptively)dilated and then modified in a filtering step 830. The effect ofdilation on a skin feature is to enlarge the size of the skin feature.The amount of dilation can be either a fixed amount for all selectedskin features or an adaptive amount based upon the characteristics ofthe skin feature. In a presently preferred embodiment, the skin featuresare adaptively dilated based upon their size and the size of the face(which is an example of a default parameter). Larger skin features aredilated more than smaller skin features. The process of dilation can becarried out using standard morphological operators.

Optimal skin enhancement is obtained by sequentially modifying skinfeatures by cycling through the steps of 810, 820, and 830 whilechanging the type of skin feature to be modified, albeit all the desiredskin features can be selected and modified in one cycle through thesteps 810, 820, and 830. In a presently preferred embodiment the valleyskin features are first selected and modified in steps 810-830, and thenthe residual peak skin features are selected and modified in the seconditeration through steps 810-830. In order to preserve the skin texture,only skin features whose sizes are between a specified minimum and amaximum size are modified. Alternatively, in order to preserve the skintexture, only skin features whose sizes are larger than a specifiedminimum size are modified. In addition, the minimum and maximum size ofthe skin features to be modified directly scale with the size of theface.

In step 830, a pinwheel filter is applied to each pixel of dilatedfeatures. Pixels of dilated features are referred to as feature pixels.All other remaining pixels are referred to as non-feature pixels. In theembodiment of the present invention, feature pixels are defined by abinary mask, where a value of 0 corresponds to feature pixels and avalue of 1 corresponds to non-feature pixels. The pinwheel filterinterpolates new values of a given feature pixel by using neighboringnon-feature pixels aligned in line segments centered at the featurepixel. The pinwheel filter is described in detail in commonly-assignedU.S. Pat. No. 6,104,839 “Method and Apparatus for Correcting PixelValues in a Digital Image”, which issued Aug. 15, 2000 in the names ofDavid R. Cok et al, and which is incorporated herein by reference. Abrief description of the pinwheel filter is included here for clarityand to specify some modifications to the original algorithm as describedin the patent by Cok et al. Referring to FIG. 9, the SET of four linesegments 930 is graphically demonstrated (vertical V, horizontal H, twodiagonal line segments D1 and D2) for the selected feature pixel 940.The four line segments are spaced at 45° degree increments. The dilatedfeatures 920 are represented in gray (shaded) color. The line 910represents a face boundary. Each line segment in the SET is composed ofboth feature and non-feature pixels on both sides of the pixel 940. Thenon-feature pixels and feature pixels in the line segment are pixelslocal to the selected feature pixel 940 in a given direction defined bythe line segment. The method of creating the SET of line segments isdescribed in detail later.

Referring to FIGS. 10A and 10B, the method for calculating new valuesfor each feature pixel in the image by applying the pinwheel filter isshown. In step 1004, the number of line segments NL, the maximum numberof pixels on one side of the line segment MAX_NP1 and the minimum numberof pixels on one side of the line segment MIN_NP1 are set. Theseparameters will be explained in detail in reference to FIG. 12. Themaximum number of pixels on one side of the line segment MAX_NP1 and theminimum number of pixels on one side of the line segment MIN_NP1 are setbased on the size of the face (which is an example of a defaultparameter). The larger the size of the face, the larger the values ofMAX_NP1 and MIN_NP1. The dependence of these two parameters upon thesize of the face is unique to the present invention compared to themethod described by Cok et al. In step 1006, the first feature pixelPSEL is selected. In step 1008, the SET of NL line segments is createdthrough the pixel PSEL. In the preferred embodiment, the number of linesegments NL in SET is equal to 4, corresponding to vertical, horizontaland two diagonal line segments.

A method of creating line segments is shown in FIG. 12. In step 1110 ofFIG. 12, the first segment is selected, e.g., the vertical line segment(V). In step 1120, the direction of one side of the line segment isselected. This is a direction in which pixels are being added to theline segment starting at pixel PSEL. For each segment, two directionsare defined that correspond to two sides of the line segment centered atpixel PSEL. In step 1130, feature pixels are being added to the linesegment until a first non-feature pixel is reached along a givendirection. In step 1140, the first non-feature pixel is added to theline segment and the neighboring non-feature pixels in a given directionare being added to the line segment until one of the followingconditions is met:

-   -   maximum number of non-feature points on one side MAX_NP1 is        reached,    -   face boundary or face feature boundary is reached,    -   new feature pixel is reached.        The maximum number of non-feature points on one side of the line        segment MAX_NP1 is set in step 1004 (FIG. 1A) based on the face        size. The line segments must not cross the face boundary or        boundaries of the regions excluded from the texture enhancement        process (like eye regions, mouth regions, etc.). The above        constraining condition for creating valid line segments is        unique to the present invention compared to the method described        by Cok et al. When adding pixels to one side of the line segment        is completed, then the direction is set for the second side of        the line segment in step 1160, and the process is repeated for        the second side of line segment in steps 1130-1140. When two        sides are completed (step 1150), then the next line segment from        the SET is selected (step 1180) and the process is repeated in        steps 1120-1160. When all NL line segments in SET are created        (step 1170) the process is completed (step 1190).

Referring back to FIG. 10A, after creating the SET of NL line segmentsin step 1008 as described above, the line segments having less thanMIN_NP1 of non-feature points on at least one side are removed from theSET (step 1010). If no remaining valid line segments are left in the SET(step 1014), then pixel values are not changed for the pixel PSEL (step1052) and a new feature pixel PSEL is selected (step 1046 and 1048) andthe process is repeated (starting with step 1008). If the number ofremaining valid line segments N in SET is greater than 0 (step 1014),then for each remaining valid line segment a linear fit is calculated(step 1016) for the non-feature pixels in the valid line segment foreach channel. In step 1018, mean square fitting error is calculated foreach valid line segment for non-feature pixels for each channel based onthe linear fit computed in the previous step 1016. In step 1020, totalmean square fit error is calculated for each valid line segment as anaverage of mean square fitting errors for all channels for a given validline segment according to the following equation. $\begin{matrix}{{{MSE}_{n} = {\frac{1}{K}{\sum\limits_{k = 1}^{K}{MSE}_{h,k}}}}{{{{where}\quad n} = 1},\ldots\quad,N}} & \left( {{EQ}.\quad 15} \right)\end{matrix}$where K is a number of channels in the image. For black and whiteimages, K is equal to 1. For color images, K is usually equal to 3 (e.g.3 channels corresponding to R,G,B channels).

In step 1022, values PSEL_(n,k) are calculated for pixel PSEL for eachvalid line segment n for each channel k based on linear fit computed instep 1016. In step 1024, new pixel values PSEL_(k) are calculated foreach channel k. The final pixel values of the enhanced image aredetermined by blending new pixel values PSEL_(k) for each channel k withthe original pixel values according to alpha masks generated in theprevious sections. The blending operation insures smooth transitionbetween enhanced and not enhanced regions of the skin. The blendingoperation in step 1024 and alpha masks are unique to the presentinvention compared to the method described by Cok et al. In analternative embodiment the final pixels values PSEL_OUT_(k) of theenhanced image are determined by adaptively blending the new pixelsvalues PSEL_(k) with the original pixels values PSEL_IN_(k) for eachchannel k.PSEL_OUT_(k) =αPSEL _(k)+(1−α)PSEL_IN_(k)  (EQ. 16)The blending coefficient α used to blend the new and original pixelvalues is dependent upon the characteristics of the of the skin featurethat the pixel originated from. For example, as shown in FIG. 17, theblending coefficient α can be a function of the size of the skin featurethat the pixel originated from. Referring to FIG. 17, for small skinfeature size whose size is less than min the original pixels values arenot modified. For the skin features whose size are between min and midthe new pixels values are used as the final pixel values. And for largeskin features whose size is greater than mid the final pixels values aredetermined by blending the new and original pixels values. The values ofmin, mid and max are one of the parameters of the texture enhancementfilter that control the look of the resulting texture enhancement, e.g.,the greater the value of min the more skin texture that is preserved inthe enhanced skin regions. The greater the value of mid the more thatwrinkles and blemishes are removed from the enhanced skin regions.Decreasing the min value and increasing the mid value results inincreased smoothness of the enhanced skin. In the interactive embodimentof the present invention the values of min, mid and max are modified bymeans of the texture enhancer slider 92 of the GUI 78. In one preferredembodiment, the min, mid, and max values for the blending function shownin FIG. 17 are determined by the distance between the eyes.

In another embodiment of the present invention, each of the values min,mid and max can be controlled by a separate slider in the interactivemode. Some skin regions may require higher level of smoothing than theother, e.g. forehead vs. cheeks vs. under eye regions. To solve thisproblem in one embodiment of the present invention the same blendingfunction showed in FIG. 17 is used for all the skin regions but min, midand max parameters depend on the region of the skin. In anotherembodiment of the present invention differently shaped blendingfunctions and parameters different than min, mid, max can be defined fordifferent skin regions to create a desired look. Some skin features mayhave the same size and be located in the same skin region but theyshould have very different blending coefficients. As mentioned beforesome specific skin features may be excluded from any texture enhancement(α=0) to preserve a certain look and/or to preserve facial symmetry(e.g. nasolabial lines). In certain regions, (e.g., around the eyes), itis sometimes preferable not to entirely remove a skin feature but tomodify its harsh appearance. Thus in another embodiment, the blendingcoefficient α is also dependent upon the type of the skin feature andregion of the skin where it is located. The skin features can beanalyzed based on their shape, color, location, etc. and classified intodifferent types like blemish, mole, laugh line, crow feet wrinkle, etc.and the different blending functions applied for different types of skinfeatures. The blending functions for some skin features like creasesunder the eyes can be different for the right and left side of the faceto match in a symmetrical way the look of the skin features on bothsides of the face after applying enhancement (e.g. darkness, softnessetc.). Different methods of calculating new pixel values PSEL k aredescribed later. If the selected feature pixel PSEL is not the lastfeature pixel (step 1046), then the next feature pixel is selected (step1048) and the process is repeated starting with step 1008. Otherwise thewhole process is completed (step 1050).

In the preferred embodiment where the number of line segments NL isequal to 4, the step of calculating new values PSEL_(k) for the selectedfeature pixel PSEL (step 1024 in FIG. 10) is shown in detail in FIG. 11.The method presented here in FIG. 11 is unique to the present inventioncompared to the method described by Cok et al. It is assumed there is atleast one valid line segment in SET (N>0). Referring to FIG. 11, ifnumber of valid line segments N in SET is equal to 1 (step 1026), thennew values PSEL_(k) for each channel k are equal to values PSEL_(1,m)calculated for that line segment (step 1028). Otherwise in step 1030,SET of valid line segments is sorted in descending order based on meansquare root error value MSE_(n) for each line segment n. As a result ofsorting in step 1030, the first valid line segment in SET (n=1) has thehighest mean square root error and the last valid line segment (n=N) hasthe lowest mean square root error in SET. If the number of valid linesegments N in SET is equal to 2 (step 1032), then new values PSEL_(k)for each channel k are equal to averaged values of PSEL_(1,k) andPSEL_(2,k) (step 1034). Otherwise, if the number of valid line segmentsN in SET is equal to 3 (step 1036), then new values PSEL_(k) for eachchannel k are equal to values of PSEL_(2,k) calculated for the validline segment with the mid value of mean square root error (n=2) (step1038). Otherwise, the number of valid line segments N is equal to 4, andnew values PSEL_(k) for each channel k are equal to averaged values ofPSEL_(2,k) and PSEL_(3,k) (step 1040). The final pixel values of theenhanced image are calculated by blending new pixel values PSEL_(k) foreach channel k with the original pixel values (step 1024) according toalpha masks generated in the previous sections.

In a second embodiment for calculating new pixel values, new valuesPSEL_(k) for each channel k (step 1024 in FIG. 0) are calculated in thefollowing way. First, weight values W_(n,k) are calculated for each linesegment n for each channel k according to the equation EQ. 17.$\begin{matrix}{{W_{n,k} = {1 - {\frac{{MSE}_{n,k}}{\sum\limits_{i = 1}^{N}{MSE}_{i,k}}\quad{where}}}}\quad\text{}{{n = 1},\ldots\quad,K}{{k = 1},\ldots\quad,K}} & \left( {{EQ}.\quad 17} \right)\end{matrix}$Next, new values PSEL_(k) are calculated for each channel as a weightedsum of PSEL_(n,k) values determined for each valid line segment n andfor each channel k according to the equation EQ. 18. $\begin{matrix}{{PSEL}_{k} = \frac{\sum\limits_{n = 1}^{N}{W_{n,k}{PSEL}_{n,k}}}{\sum\limits_{n = 1}^{N}W_{n,k}}} & \left( {{EQ}.\quad 18} \right)\end{matrix}$The final pixel values of the enhanced image are calculated by blendingnew pixel values PSEL_(k) for each channel k with the original pixelvalues according to alpha masks (step 1024) generated in the previoussections. The blending operation and alpha masks are unique to thepresent invention compared to the method described by Cok et al.

When a large amount of texture enhancing is applied to the skin theresulting skin texture can be very smooth and uniform across the wholeface. Heavy enhancing of the face to remove severe acne can leave theface very smooth. Depending upon the desired look of the enhanced image,skin that lacks fine scale structure may or may not be acceptable. Thisis especially true for images where the resulting smoothness of theenhanced image varies abruptly across different regions of the face. Ifregions of the skin appear to be too smooth or devoid of texture afterapplying the pinwheel interpolation then if desired idealize texture canbe added back to these regions to give an acceptable appearance. Thefunction of the idealized texture is to generate a visually appealingimage when the idealized texture is applied to the smooth regions of theskin.

The idealized texture can be correlated or uncorrelated noise, textureobtained from skin, or a visually similar texture pattern. Idealizedskin texture can be directly extracted from photographs of individualswith good skin texture or can be generated from representative images ofskin texture using texture synthesis techniques as described in“Pyramid-Based Texture Analysis/Synthesis”, Computer GraphicsProceedings, pages 229-238, 1995. Alternatively, idealized texture canbe generated directly from individuals as described in “Real-time,Photo-realistic, Physically Based Rendering of Fine Scale Human SkinStructure”, A. Haro, B. Guenter, and I. Essa, Proceedings 12thEurographics Workshop on Rendering, London, England, June 2001. In apresently preferred embodiment, in order to generate a visuallyappealing image it is desirable to spatially scale the idealized texturebased upon the size of the face. Specifically, the separation betweenthe eyes is used to determine the scaling factor.

In its simplest embodiment, the skin region can be retexturized byadding the idealized texture uniformly across the skin region delineatedby the feature points 420S _(out)(x,y)=S _(in)(x,y)+γTex(x,y)  (EQ. 19)where S_(in)(x,y) is the skin pixel at location (x,y) beforeretexturing, S_(out)(x,y) is the skin pixel after retexturing, Tex(x,y)is the texture component to be added to the skin at pixel (x,y), and γis a scaling factor. The retexturing operation is applied to all thecolor channels. If desired, the magnitude of the texture added to theskin can be set to be a function of the level of enhancement. Referringto the retexturing curves shown in FIG. 21 a, as the level ofenhancement is increased the amount of texture added to the skin regionis also increased. In an interactive embodiment, the amount of textureadded to the skin can be tied to the texture enhancement slider 92. Byvarying the shape and magnitude of the retexturing curve differentappearances can be imparted to the enhanced skin.

The texture component is a high frequency component that fluctuatesaround zero. The texture component can also vary as a function of theskin location. The appearance of the fine scale structure of skin variessmoothly across the face yet each region of the skin has a very distinctappearance. For example, forehead fine scale structure is distinctlydifferent from nose fine scale structure.

In a preferred embodiment, retexturing can be applied adaptively to theskin based upon the local smoothness of the skinS _(out)(x,y)=S _(in)(x,y)+γ(x,y)Tex(x,y)  (EQ. 20)where the scaling factor γ(x,y) is a function of the smoothness of theskin ss(x,y) at pixel location (x,y). Any number of statistical texturemeasures or high pass filters can be used to measure the localsmoothness of the skin ss(x,y). For example, variance filters, edgefilters, second difference filters, etc. are useful in calculating thelocal smoothness of the skin. Referring to FIG. 21 b, there are showntwo representative retexturing functions useful in practicing thecurrent invention. As the local smoothness of the skin increases thescaling factor γ also increases thus causing a larger amount of textureto be added to the skin. By changing the shape and magnitude of theretexturing function different appearances can be imparted to enhancedskin, The majority of the skin features that we wish to modifycorrespond to valley features i.e., a dark area surrounded by a lightarea. In most instances, skin features are going to be modifiedregardless of the color information associated with the pixels that havebeen identified as skin features, albeit there may be instances where anindividual may not want a defining facial characteristic such as abeauty mark to be removed from the photograph of the individual. Inthese instances, the color information associated with the skin featurepixels can be used in determining the type of skin feature that shouldor should not be removed. An alternative approach is to build a toolinto the Graphical User Interface that will allow the operator to undoan undesirable modification (e.g., the removal of a desirable beautymark). In a preferred embodiment, the user chooses an undo/redo toolfrom the graphical list of tools 84, and moves the undo/redo tool viapointing device 40 such as a mouse to the location of the skin featurein the original image 80 the user wishes to restore. Clicking on theskin feature in the original image 80, which is displayed on the left,causes the feature to be added back to the enhanced image 82, which isdisplayed on the right. Clicking again on the restored skin feature inthe original image now causes the skin feature to be removed from theenhanced image. Thus, the undo/redo tool works, toggling back and forth,by either removing a skin feature from the enhanced image if it ispresent in the enhanced image or restores it to the enhanced image if itis not present in the enhanced image. In an alternative embodiment, thetexture enhancer slider 92 can be set to no enhancement and the tool 84can be used to allow the user to choose which skin features to remove.

In another embodiment, the graphical user interface acquires anddisplays a digital image containing one or more faces. A skin featuremap is generated by use of any of the aforementioned techniques toidentify and map the skin features; the skin feature map thereforerepresents the skin features on the one or more faces in the digitalimage. The pointing device 40 is then used to point to a particular skinfeature. In response to a point and click operation of the pointingdevice, the skin feature map is referenced as to the particular featureand the appropriate enhancement for that feature, provided by anappropriate enhancement filter, is initiated for the skin feature beingpointed at.

Skin Tone Enhancement Filter.

The task of the skin tone enhancing filter 620 (FIG. 6) is to improvethe overall appearance of the skin tone. The skin tone filter evens outunbalanced skin tone and creates a more even colored skin tone. Inaddition, the skin tone filter is used to modify the color of the skintone to produce a more desirable skin color representation. Thiscorresponds to modifying both the luminance and chrominance of the skinto match individual and culture preferences of skin tone rendition.Moreover, skin tone problems tend to be on a larger spatial scale thantexture. It is important not to even out the skin tone too much becausefaces without highlights or shadows are flat and tend to beuninteresting.

Referring to FIG. 13, there is shown a flowchart for a presentlypreferred embodiment of a skin tone enhancing filter according to thepresent invention. The skin tone-enhancing filter adaptively compresseshighlights and shadows by adaptively blending (in a blending step 1240)the input image I(x) with a blurred version I_(b)(x) of the input imageobtained from a blending step 1210, as follows.O(x)=α(x)I _(b)(x)+(1−α(x))I(x)  (EQ. 21)where α(x) is a blending coefficient obtained from a coefficientgeneration step 1230 and x=(x,y) is the location of a pixel. Theblending operation is applied to all the color channels. The blendingcoefficient is a function of the shadow/highlight SH(x) strength imageat x obtained from the shadow/peak generation step 1220, as follows.α(x)=f [SH(x)]  (EQ. 22)

Referring to FIG. 14, there is shown a presently preferred embodiment ofcalculating the shadow/highlight strength image according to the presentinvention. The shadow/highlight strength image from step 1220 isgenerated by subtracting an average luminance image 1320 from aluminance image 1310. The luminance image is calculated by usingequation EQ. 2. The average luminance image can be either a localaverage luminance image or a global average luminance. A local averageluminance image can be generated by applying a blur filter such as aGaussian or box filter to the luminance image, whereas the globalaverage luminance is calculated by determining the average luminance ofthe skin within the skin region delineated by the feature points. Theshadow/highlight strength is analogous to a valley/peak image when usingthe local average image to calculate the shadow/highlight image. In apreferred embodiment, the blur radius used to calculate theshadow/highlight map should be larger than the blur radius or extent ofthe valley/peak detector used in the texture enhancing filter. In eithercase, the blur radius is dependent upon the size of the face (which isan example of a default parameter).

In its simplest embodiment, the blending coefficient is a constantf[SH(x)]=α(x)=α, which is an example of a default parameter, and is notdependent upon the shadow/highlight strength image as shown in FIG. 15A.The blending functions shown in FIGS. 15B and 15C are useful for toningdown highlights and hot spots caused by lights and/or oily skin, whileleaving shadow regions unchanged.

The skin tone filter can also be used to modify the color rendition ofthe skin. In a presently preferred embodiment, the color C of a regionsuch as the skin region can be modified C_(mod) by shifting the mean andvariance of the color distribution of a region as followsC_(mod)(x,y)=k(C(x,y)−{overscore (C)})+C  (EQ. 23)where the vector C(x,y) corresponds to the pixel's red (R), green (G),and blue (B) signal, C_(preferred) is the preferred color vector,{overscore (C)} is the current mean color vector, and k is a constantthat can vary between 0 and 1. The preferred color C_(preferred)(x,y)can vary spatially depending upon the region of the skin to be modified.

A preferred embodiment for lightening or darken the skin region is tomodify the contrast of the skin region as followsC _(mod)(x,y)=C ^(γ)(x,y)  (EQ. 24)where values of γ less than one correspond to lightening the skin colorand values of γ greater than one correspond to darkening the skin color.

An alternative embodiment for lightening the skin region is given by$\begin{matrix}{C_{mod} = \frac{C}{1 - {\gamma\left( {1 - C} \right)}}} & \left( {{EQ}.\quad 25} \right)\end{matrix}$and for darkening the skin region is given by $\begin{matrix}{C_{mod} = {1 - \frac{1 - C}{1 - {\gamma\quad C}}}} & \left( {{EQ}.\quad 26} \right)\end{matrix}$where γ varies between 0 and 1.

The above approach is also applicable when C is represented in othercolor spaces, e.g., CIELAB, YUV, HSV, etc. In addition, these equationcan be applied to all or a subset of the components of C. This isparticularly true when C is represented in a color space (e.g., CIELAB)where the components are related to the luminance (L*) and chrominance(a*b*).

Teeth and Eye Enhancing Filter.

The task of the teeth and eye enhancing filter(s) 630 and 640 (FIG. 6)is to increase the luminance and whiteness of the teeth and eyes.Referring to FIG. 16, there is shown a flowchart for a presentlypreferred embodiment of a teeth and eye whitening filter according tothe present invention. At an eye/teeth mask generation step 1510, thesalient facial feature points 420 (FIG. 4) are used to generate a maskthat identifies pixels that correspond to the eye and teeth regions.Using the input image at a valley/peak map generation step 1520, thevalley/peak map is generated using Eq. 14 where the radius of the bluris determined by the eye separation (which is an example of a defaultparameter). At a scaling factor generation step 1530, the valley/peakmap and the color information are used to calculate scaling factors(which are examples of default parameters) for the luminance andchrominance values of the pixels within the eye and teeth masks. Then ata pixel modification step 1540, the scaling factors are applied to theluminance and chrominance values of the pixels within eye and teethregions generating new luminance and chrominance values.

In a presently preferred embodiment, the RGB values for pixels withinthe mask regions are converted to CIELAB (L*a*b*) space and theluminance and chrominance values are modified as follows,L ^(*) =L ^(*)·(1+kP)  (EQ. 27)a ^(*) =a ^(*)/(1+kP)  (EQ. 28)b ^(*) =b ^(*)/(1+kP)  (EQ. 29)where k is the aforementioned default parameter and P is the probabilitythat the pixel belongs either to the whites of the eyes or to a tooth. Apresently preferred expression for the probability P is as follows,$\begin{matrix}{P = \left\{ \begin{matrix}{1 - {{F/\beta}}} & {{{if} - \beta} \leq F \leq 0} \\0 & {otherwise}\end{matrix} \right.} & \left( {{EQ}.\quad 30} \right)\end{matrix}$where F is calculated using Eq. 14 with a blur radius chosen as afunction of the face size and β is a threshold.

In some images the colors of the teeth are very uneven and/or the colorsof the whites of the two individual eyes are significantly differentfrom each other. In these cases, increasing the luminance and whitenessof the teeth and eyes may have an unwanted deleterious effect ofaccentuating the uneven color of the teeth and/or eyes. Balancing thecolor and uniformity of the teeth and eyes usually increases thesubjective acceptability of the picture of a given face.

A presently preferred embodiment for balancing the color and uniformityof the teeth and whites of the eyes is based upon the technique used tomodify the color rendition of the skin (see above). The color C of thepixels defining the teeth or whites of the eye can be modified C_(mod)by shifting the mean and variance of the color distribution of thesepixels according to Eq. 23. Where the vector C(x,y) corresponds to thepixel's color signal (L,a,b), C_(preferred) is the preferred colorvector (L_(p),a_(p),b_(p)), {overscore (C)} is the current mean colorvector ({overscore (L)},{overscore (a)},{overscore (b)}), and k is aconstant that can vary between 0 and 1. As indicated by Eq. 23, thismodification can be applied to all three color channels or alternativelyto a subset of the color channels (e.q only the L channel). To increasethe brightness and whiteness the preferred color should be chosen sothat L_(p)>{overscore (L)} and the color saturation of the preferredcolor is less than the color saturation of the mean color vector. Toequalize the whites of the two eyes, the same preferred color can beused for both eyes or alternatively the preferred color of each eye isdifferent but the color different between them is smaller than the colordifference of the mean color vector for each eye.

Shape Enhancement Filter

The task of the shape enhancing filter 650 (shown in FIG. 6) is tomodify the shape of facial features such as the eyes, nose and mouth.The shapes of the facial feature are enhanced by modifying their shapeusing standard warping techniques. An example of a warping techniqueuseful for practicing the current invention is given by T. Beier and S.Neely. Feature-Based Image Metamorphosis, Computer Graphics, 26(2):35-42, New York, N.Y., July, 1992, Proceedings of SIGGRAPH '92, which isincorporated herein by reference.

The shape modification is designed to create a more preferred look ofthe face. For example, if the eyes are slightly closed in the image itmay be preferable to open them to some degree by using morphingtechniques. Also enhancing symmetry of the facial features usuallyincreases subjective acceptability of the picture of a given face. Forexample, by equalizing the shape of both eyes the picture of the faceusually has higher subjective acceptability. In the same manner,changing shape of a mouth may create more a preferred look by modifyingoverall facial expression.

Referring to FIG. 19, there is shown a flowchart for a presentlypreferred embodiment of a shape enhancing filter 650 according to thepresent invention. At a source control point determination step 1910,the source control points 1810 (see FIG. 18A) that are used for warpingthe image are determined by the feature points 420 (see FIG. 4)delineating the facial feature (e.g., eye) to be shape enhanced. In adestination control point determination step 1920, the destinationcontrol points 1820 are determined. The location of destination controlpoints 1820 defines the new location of the source control points 1810in the shape modified image. The destination control points 1820 (D1,D2, D3, and D4) are respectively the new locations of the source controlpoints 1810 (S1, S2, S3, and S4). In a warping step 1930, the source anddestination control points are used to warp the image. The location ofthe destination control points 1820 are defined by the desired change ofthe facial feature shape. For example, if it is desired to increase thesize of the eyes the destination control points 1820 are positioned asshown in FIG. 18A. To better control shape changes some of the controlpoints may include feature points as shown in FIG. 18B. Source controlpoints S5, S6, S7, S8 are corresponding to eye feature points. Thedestination control points D5, D6, D7, D8 are defining a new eye shapecreated as a result of warping. Source and destination control points S1and D1, S2 and D2, S3 and D3, S4 and D4 are the same to limit changescreated by warping to the area within the bounding rectangle (S1, S2,S3, S4). In the preferred embodiment, to equalize shape of the eyes,destination control points (D5, D6, D7, D8) of one eye must matchrelative locations of feature points of the other eye. In the preferredembodiment, when changing shape of the eyes (e.g. opening eyes) thedestination control points for left eye (D5, D6, D7, D8) and destinationcontrol points for the right eye (D5′,D6′,D7′,D8′, i.e., where thereference characters are the same as those used as FIG. 18B but primed(′) to refer to the right eye) are defined in the way to ensure equalchanges in shape for both eyes by matching lengths and directions ofcorresponding line segments between left and right eye [S5, D5] and[S5′,D5′], [S6, D6] and [S6′,D6′ ], [S7, D7] and [S7′,D7′ ], [S8, D8]and [S8′,D8′ ].

In a presently preferred embodiment, the parameters of the shapeenhancing filter are used to define whether the facial feature shape isincreased or decreased by specifying the location of the destinationcontrol points 1820. The shape enhancing filter can be incorporated intothe GUI screen 78 (see FIG. 1B) through an additional slider control.Moreover, there may be a unique shape enhancing slider for each facialfeature. The system maps the position of the slider into appropriateparameter values of the shape enhancement filters. Moving the slider inone direction causes the facial feature to decrease in size while movingthe slider in the opposite direction causes the facial feature toincrease in size. Because symmetry is very important for facialappearance, in the preferred embodiment when manipulating shape ofsymmetrical facial features as eyes the shape symmetry is ensured asdescribed above. The default position of the respective slider thuscould be a neutral position not effecting any shape enhancement (untilthe slider is moved one way or the other).

Throughout the foregoing description, certain parameters have beenspecified as candidates for system default parameters, which, e.g.,determine the initial settings of the enhancement filters and theinitial settings of the enhancement sliders used in the graphical userinterface. These parameters have been selected without limitation asexamples of appropriate default parameters and should not be seen as adefinitive or limiting set of parameters. It should be clear to one ofordinary skill in this art that many other parameters, including otherscited in this description, could be chosen and/or designated as defaultparameters.

PARTS LIST

-   10 system-   12 personal computer (PC)-   20 storage media-   28 scanner-   30 digital camera-   40 input devices-   50 display monitor-   60 printer-   62 server-   65 storage media-   70 communication network-   78 graphical user interface (GUI) screen-   80 original image-   82 enhanced image-   90 appearance enhancer-   92 texture enhancer-   94 skin enhancer-   96 eye enhancer-   98 teeth enhancer-   200 initiation step-   205 acquisition and display step-   210 locate step-   215 display step-   220 decision step-   225 modify step-   230 default setup step-   235 execution step-   240 user selection step-   245 display step-   250 decision step-   255 local print step-   260 local archive step-   265 remote print step-   270 remote archive step-   275 query step-   280 ending step-   282 acquisition step-   284 face detection and location step-   286 enhancement selection step-   288 enhancement execution step-   290 face query step-   292 storage step-   294 image query step-   310 face detection module-   315 facial feature detector-   410 detected face-   420 salient feature points-   550 generic mapping step-   554 scaling step-   556 skin color mapping step-   558 map combination step-   570 central region with generic mask-   572 border region-   574 outline of neck probability map-   576 central region-   610 skin texture enhancement filter-   620 skin tone enhancement filter-   630 teeth enhancement filter-   640 eye enhancement filter-   650 facial feature shape enhancement filter-   670 forehead bounding region defined-   672 step of creating probability feature maps-   674 step of combining probability maps-   710 skin feature generation step-   720 feature modification step-   810 feature selection step-   820 dilation step-   830 filtering step-   910 face boundary-   920 dilated features-   930 line segments-   940 feature pixel-   1002--   1190 pinwheel filter steps-   1210 blurring step-   1220 shadow/peak generation step-   1230 coefficient generation step-   1240 blending step-   1310 luminance image-   1320 average luminance image-   1330 subtracting step-   1510 eye/teeth mask generating step-   1520 valley/peak map generating step-   1530 scaling factor generation step-   1540 pixel modification step-   1810 source control points-   1820 destination control points-   1910 source control point determination step-   1920 destination control point determination step-   1930 warping step-   2000 acquisition step-   2010 display step-   2020 accept/reject decision step-   2030 interactive retouching mode-   2040 accept/reject decision step-   2050 cleanup step-   2060 query step-   2100 fulfillment initiation-   2105 acquisition step-   2110 face detection-   2120 face suitability decision-   2130 filter execution step-   2140 enhanced image display-   2150 image acceptability decision-   2160 enhanced decision-   2170 interactive enhancement step-   2180 display non-face image-   2190 conventional image fulfillment kiosk processing

1-63. (canceled)
 64. A processing method for enhancing an appearance ofa face located in a digital image that is processed in auser-interactive kiosk environment, the method comprising the steps of:acquiring an original digital image containing one or more faces;detecting a face in the original digital image; processing the originaldigital image to determine if the face is suitable for enhancement basedon at least one of size and state of focus of the face in the image; ifthe face is found to be acceptable for enhancement relative to apredetermined threshold related to size and state of focus, thenenhancing the image according to one or more enhancement algorithms anddisplaying the image for review by a user of the kiosk; and if the faceis found not to be acceptable by the user, then providing an interactiveretouching mode for the user to interactively adjust the one or moreenhancement algorithms until the image is acceptable.
 65. Auser-interactive photographic kiosk for processing a digital image forenhancing an appearance of a face located in the image, the kioskcomprising: an input interface for acquiring an original digital imagecontaining one or more faces; a processor for (a) detecting a face inthe original digital image; (b) processing the original digital image todetermine if the face is suitable for enhancement based on at least oneof size and state of focus of the face in the image; and (c) if the faceis found to be acceptable for enhancement relative to a predeterminedthreshold related to size and state of focus, then enhancing the imageaccording to one or more enhancement algorithms; a display fordisplaying the enhanced image for review by a user of the kiosk; and aninteractive retouching mode for enabling the user, if the face is foundnot to be acceptable, to interactively adjust the one or moreenhancement algorithms until the image is acceptable. 66-69. (canceled)70. A processing method for enhancing an appearance of a face located ina digital image that is processed in a user-interactive kioskenvironment, the method comprising the steps of: acquiring an originaldigital image; detecting one or more faces in said original digitalimage; identifying among said detected faces one or more faces meetingpredetermined enhancement criteria to provide one or more enhanceablefaces; enhancing said one or more enhanceable faces to provide anenhanced image; displaying said enhanced image to the user; concurrentwith said displaying, allowing the user to select one of: (a) continuingprocessing with said enhanced image, (b) continuing processing with saidoriginal image, and (c) manually retouching said original image toprovide a retouched image; wherein said detecting, identifying, andenhancing steps are non-interactive with the user.
 71. The method ofclaim 70 wherein said enhancement criteria are based upon at least oneof size and sharpness of the respective said face in said originaldigital image.
 72. The method of claim 70 wherein said enhancementcriteria are based upon both size and sharpness of the respective saidface in said original digital image.
 73. The method of claim 72 whereinsaid detecting further comprises locating facial feature points on eachof said faces and segmenting each of said detected faces into two ormore regions using said facial feature points; and said enhancingfurther comprises applying one or more enhancement filters to one ormore of said regions of each of said enhanceable faces, said enhancementfilters each being customized to a respective said region.
 74. Themethod of claim 73 wherein said regions include two or more of: facialskin, eyes, nose, mouth, hair, facial hair, and neck regions.
 75. Themethod of claim 73 further comprising: determining one or more faciallyrelevant characteristics of the different regions, and selecting one ormore parameters of one or more of said filters based on said determinedfacially relevant characteristics of the respective said regions. 76.The method of claim 75 wherein said facially relevant characteristicsinclude at least one characteristic selected from the group: a size ofthe face, a distance between facial features in the respective saidregion, a gender of the respective said face, and an age of therespective said face.
 77. The method of claim 75 wherein one of saidfacially relevant characteristics is gender of said one or more facesand said method further comprises determining the gender of respectivesaid faces prior to said selecting.
 78. The method of claim 75 whereinone of said facially relevant characteristics is age of said one or morefaces and said method further comprises determining the ages ofrespective said faces prior to said selecting.
 79. The method of claim75 wherein one of said facially relevant characteristics is distancebetween eyes of respective said faces and said method further comprisesdetermining said distance in respective said faces prior to saidselecting.
 80. The method of claim 70 wherein said detecting furthercomprises locating facial feature points on each of said faces andsegmenting each of said detected faces into two or more regions usingsaid facial feature points; and said enhancing further comprisesapplying one or more enhancement filters to one or more of said regionsof each of said enhanceable faces, said enhancement filters each beingcustomized to a respective said region.
 81. The method of claim 70further comprising completing processing without further interactionwith the user, when the user selects: (a) continuing processing withsaid enhanced image or (b) continuing processing with said originalimage.
 82. The method of claim 81 wherein said completing processingfurther comprises printing the respective said image.
 83. The method ofclaim 70 wherein said acquiring further comprises one of: scanning aphoto, scanning a negative, receiving a file contained on digital media,and receiving a file via a communication link to a network.
 84. Aprocessing system for enhancing an appearance of a face located in adigital image that is processed in a user-interactive kiosk environment,the system comprising: an input interface adapted to acquire an originaldigital image; a processor adapted to: detect one or more faces in saidoriginal digital image; identify among said detected faces one or morefaces meeting predetermined enhancement criteria to provide one or moreenhanceable faces; and enhance said one or more enhanceable faces toprovide an enhanced image; a display adapted to display said enhancedimage to the user; wherein said processor is adapted to accept userinput via said input interface when said enhanced image is displayed,said user input selecting one of: (a) continuing processing with saidenhanced image, (b) continuing processing with said original image, and(c) manually retouching said original image to provide a retouchedimage, said user interface being otherwise non-interactive.
 85. Thesystem of claim 84 wherein said processor is adapted to locating facialfeature points on each of said faces and segment each of said faces intotwo or more regions using said facial feature points; and apply one ormore enhancement filters to one or more of said regions of each of saidenhanceable faces, said enhancement filters each being customized to arespective said region.
 86. The system of claim 85 wherein saidprocessor is adapted to: determine one or more facially relevantcharacteristics of the different regions, and select one or moreparameters of one or more of said filters based on said faciallyrelevant characteristics of the respective said regions.
 87. Theprocessing system of claim 84 wherein said processor has an interactivemode wherein said processor accepts said user input and anon-interactive mode wherein said processor is non-interactive with saiduser input.